<?php
/**
 * @author wesley
 * @version v1.0
 * @time 2021/6/30 10:43
 * @desc
 */

namespace app\api\model;



use think\Db;
use think\db\Query;

class Banner extends BaseModel
{
    public function items()
    {
        return $this->hasMany('BannerItem','banner_id','id');
    }

    public static  function getBannerById($id): string
    {
        $banner = Banner::where('id',$id)->find();
//        $banner = Query::table('banner_item')->where('banner_id','=',$id)->select();
        return $banner;
    }
}